﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Tool;

namespace AutoMachine
{
    public partial class Frm_Param : Form
    {
        Tool.AutoResize FormResize = new Tool.AutoResize();//窗体缩放实例化
        public Frm_Param()
        {
            InitializeComponent();
           
        }

        #region 窗体实例化
        /// <summary>
        /// 窗体对象实例化
        /// </summary>
        private static Frm_Param _instance;
        public static Frm_Param Instance
        {
            get
            {
                if (_instance == null)
                    _instance = new Frm_Param();
                return _instance;
            }
        }
        #endregion

        private void Frm_Param_Load(object sender, EventArgs e)
        {
            FormResize.SetAutoResize(this);//窗体缩放实例化
            this.label2.Text = "程序路径:" + " " + Application.StartupPath;
            SystemCfg.ReadParamXmlToDGV(this.dgvParam);
        }

        //数据刷新
        private void roundButton1_Click(object sender, EventArgs e)
        {
            this.label2.Text = "程序路径:" + " " + Application.StartupPath;
            SystemCfg.ReadParamXmlToDGV(this.dgvParam);
        }
        //数据保存
        private void roundButton2_Click(object sender, EventArgs e)
        {
            SystemCfg.WriteParamDgvToXml(this.dgvParam);
            SystemCfg.WriteParamXmlToSystem();
        }
        //数据下载
        private void roundButton3_Click(object sender, EventArgs e)
        {

        }
    }
}
